<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>阅读</title>
    <style>
        body,
        h2,
        p {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #444;
            color: #333;
            font-family: Helvetica, sans-serif;
        }

        #book {
            /* 书本封面 */
            background: url("/static/zbook/pics/book_bg.png") no-repeat;
            position: absolute;
            width: 960px;
            height: 600px;
            left: 50%;
            top: 50%;
            margin-left: -480px;
            margin-top: -300px;
        }

        #pages section {
            /* 书本页 */
            background: url("/static/zbook/pics/page_bg.png") no-repeat;
            display: block;
            width: 460px;
            height: 580px;
            position: absolute;
            left: 480px;
            top: 10px;
            overflow: hidden;
        }

        #pages section>div {
            display: block;
            width: 460px;
            height: 550px;
            font-size: 1em;
            line-height: 2em;
        }

        #pages section p,
        #pages section h2 {
            padding: 3px 35px;
            line-height:2em;
            text-align: justify;
        }

        #pages section h2 {
            margin: 15px 0 10px;
        }

        #pageflip-canvas {
            position: absolute;
            z-index: 100;
        }
    </style>

</head>

<body>
    <div id="book">
        <canvas id="pageflip-canvas"></canvas>
        <div id="pages">
            {% for page in pages %}
            <section>
                <div>
                    <h2>{{ page["title"] }}</h2>
                    <p>
                        {{ page["content"].replace('\n', '<br>')|safe }}
                    </p>
                </div>
            </section>
            {% endfor %}
        </div>
    </div>
    <script type="text/javascript" src="/static/zbook/js/reader.js"></script>
</body>
<html>